import styles from './Modal.module.css';
import {ReactNode} from "react";

export interface ModalProps {
    opened: boolean;
    children: ReactNode | ReactNode[];
}

export default function Modal(props: ModalProps) {
    let { opened, children } = props;

    let className: string = opened
        ? `${styles.modal} ${styles.opened}`
        : styles.modal;

    return (
        <div className={className}>
            {children}
        </div>
    );
}